package com.hp.staticproxy;

/**
 * 手机代理商
 */
public class CellphoneShop implements CellphoneSales{

    //被代理的工厂对象
    private CellphoneSales factory;

    //创建代理者对象时传入被代理对象
    public CellphoneShop(CellphoneSales factory) {
        this.factory = factory;
    }

    public void sell(String brand) {
        //扩展
        System.out.printf("为%s手机打公告\n",brand);
        //调用被代理者原来的功能
        factory.sell(brand);
        System.out.printf("为%s手机做售后\n",brand);
    }
}
